
#ifndef _G711INTERFACE_H_
#define _G711INTERFACE_H_


#ifdef __cplusplus
extern "C" {
#endif
	
	
#define   G711_NOERR   0
#define   G711_ERROR   1
	
	
	
#define G711FRAME_SIZE    80
#define G711STREAM_SIZE   80
	
	
	
	typedef enum _G711Flag
	{
		A_Law = 0,
			U_Law = 1
	} G711Flag_t;
	
	// speech size must be G711FRAME_SIZE
	// stream size must be G711STREAM_SIZE
	typedef struct _G711EncodeParam {
		short *speech;
		unsigned char *stream;
		G711Flag_t   flag;
	} G711EncodeParam_t;
	
	
	typedef struct _G711DecodeParam {
		short *speech;
		unsigned char *stream;
		G711Flag_t flag;
	} G711DecodeParam_t;
	
	
	int  G711EncodeFrame(G711EncodeParam_t *pParam);
	int  G711DecodeFrame(G711DecodeParam_t *pParam);
	
	
	
	
#ifdef __cplusplus
}
#endif


#endif